package com.base.cn.platform.os.service.course.qa.record;

import com.base.cn.platform.os.service.FeignAuthConfig;
import com.base.cn.platform.os.service.course.CourseBaseService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;
import java.util.Map;

/**
 * 老师问答分成提现记录接口
 *
 * @author s.li
 * @date 2018/11/27
 */
@FeignClient(name= CourseBaseService.appName, configuration = FeignAuthConfig.class)
public interface QaTeacherCashRecordService extends CourseBaseService {

    /**
     * 创建老师提现记录
     * @param teacherId 老师ID
     * @param accountType 提现的账号类型
     * @param account 账号
     * @param realName 账号名真实姓名
     * @param createUserId 创建人ID
     * @param recordType 记录类型，1问答分成，2旁听分成
     * @return  Map<String,Object>
     */
    @RequestMapping(contextPath + "/createQaTeacherCashRecord")
    Map<String,Object> createQaTeacherCashRecord(@RequestParam("teacherId") BigDecimal teacherId,
                                                 @RequestParam("accountType") int accountType,
                                                 @RequestParam("account") String account,
                                                 @RequestParam("realName") String realName,
                                                 @RequestParam("createUserId") BigDecimal createUserId,
                                                 @RequestParam("recordType") int recordType);

    /**
     * 分成查询老师申请提现记录
     * @param teacherCashRecord 查询对象
     * @param currentPage 页码
     * @param pageSize 查询数量
     * @return PageInfo<QaTeacherCashRecord>
     */
    @RequestMapping(contextPath + "/findQaTeacherCashRecordPage")
    Map<String,Object> findQaTeacherCashRecordPage(@RequestBody Map<String, Object> teacherCashRecord,
                                                   @RequestParam(value = "currentPage", required = false, defaultValue = "1") int currentPage,
                                                   @RequestParam(value = "pageSize", required = false, defaultValue = "10") int pageSize);

    /**
     * 获取提现申请详情
     * @param teacherCashRecord 查询条件
     * @return Map<String,Object>
     */
    @RequestMapping(contextPath + "/getTeacherCashRecordInfo")
    Map<String,Object> getTeacherCashRecordInfo(@RequestBody Map<String, Object> teacherCashRecord);

    /**
     * 查询问答提现详情的数据列表
     * @param params 查询参数
     * @param recordType 提现类型，1问答分成，2旁听分成
     * @param currentPage 页码
     * @param pageSize 查询数量
     * @return PageInfo<? extends QaRecordBaseEntity>
     */
    @RequestMapping(contextPath + "/getTeacherCashRecordInfoListData")
    Map<String,Object> getTeacherCashRecordInfoListData(@RequestBody Map<String, Object> params,
                                                        @RequestParam("recordType") int recordType,
                                                        @RequestParam(value = "currentPage", required = false, defaultValue = "1") int currentPage,
                                                        @RequestParam(value = "pageSize", required = false, defaultValue = "10") int pageSize);
    /**
     * 通过审核
     * @param id 记录ID
     * @return Map<String,Object>
     */
    @RequestMapping(contextPath +"/adoptApply")
    Map<String,Object> adoptApply(@RequestParam("id") BigDecimal id, @RequestParam("sysUserId") BigDecimal sysUserId);
}
